﻿using MVCUserInput.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace MVCUserInput.Models
{
    public static class DB
    {
        private static List<ToDo> _tasks { get; set; }
        public static List<ToDo> Tasks
        {
            get
            {
                if (_tasks == null)
                {
                    _tasks = new List<ToDo>()
                    {
                        new ToDo() { ToDoId = 1, Task = "Learn Razor", DateCreated = DateTime.Now, DateCompleted = null },
                        new ToDo() { ToDoId = 2, Task = "Learn C#", DateCreated = DateTime.Now, DateCompleted = null },
                        new ToDo() { ToDoId = 3, Task = "Learn JavaScript", DateCreated = DateTime.Now, DateCompleted = null },
                        new ToDo() { ToDoId = 4, Task = "Learn Angular", DateCreated = DateTime.Now, DateCompleted = DateTime.Now },
                        new ToDo() { ToDoId = 5, Task = "Learn SQL", DateCreated = DateTime.Now, DateCompleted = DateTime.Now },
                        new ToDo() { ToDoId = 6, Task = "Learn Entity Framework", DateCreated = DateTime.Now, DateCompleted = DateTime.Now }
                    };
                }
                return _tasks;
            }
            set
            {
                _tasks = value;
            }
        }
    }
}